package servlets;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

import bean.Articles;
import bean.SearchArt;

@SuppressWarnings("serial")
public class searchServlet extends HttpServlet{
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		req.setCharacterEncoding("big5");
		String searchName = req.getParameter("searchName");
		SearchArt sr = new SearchArt();
		List<Articles> art = (List<Articles>) sr.searchByItem(searchName);
		
		req.setAttribute("articles", art);
		req.getRequestDispatcher("./group/result.jsp").forward(req, resp);
	}
}
